Source File
doc.go
Belonging Package
github.com/K-Phoen/grabana
/*Package grabana provides a developer-friendly way of creating Grafana dashboards.Whether you prefer writing **code or YAML**, if you are looking for a way toversion your dashboards configuration or automate tedious and error-pronecreation of dashboards, this library is meant for you.builder := dashboard.New("Awesome dashboard",dashboard.VariableAsInterval("interval",interval.Values([]string{"30s", "1m", "5m", "10m", "30m", "1h", "6h", "12h"}),),dashboard.VariableAsQuery("status",query.DataSource("prometheus-default"),query.Request("label_values(prometheus_http_requests_total, code)"),query.Sort(query.NumericalAsc),),dashboard.Row("Prometheus",row.WithTimeSeries("HTTP Rate",timeseries.WithPrometheusTarget("rate(promhttp_metric_handler_requests_total[$interval])",prometheus.Legend("{{handler}} - {{ code }}"),),),row.WithTable("Threads",table.WithPrometheusTarget("go_threads"),table.HideColumn("Time"),table.AsTimeSeriesAggregations([]table.Aggregation{{Label: "AVG", Type: table.AVG},{Label: "Current", Type: table.Current},}),),row.WithStat("Heap Allocations",stat.Unit("bytes"),stat.WithPrometheusTarget("go_memstats_heap_alloc_bytes"),),),dashboard.Row("Some text, because it might be useful",row.WithText("Some awesome html?",text.HTML("<b>lalalala</b>"),),),)For a more information visit https://github.com/K-Phoen/grabana*/package grabana
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |